/*
 * @lc app=leetcode.cn id=7 lang=golang
 *
 * [7] 整数反转
 */

// @lc code=start
func reverse(x int) int {
	var n int
	for x != 0 {
		n = n*10 + x%10
		x = x / 10
	}
	if n > 0x7FFFFFFF || n < -0x80000000 {
		return 0
	}
	return n
}

// @lc code=end

